package pt.iscte.pcd.containersizeproblem;
import java.awt.Container;
import java.awt.Dimension;

import javax.swing.JComponent;
import javax.swing.JFrame;


public class Main {

	private JFrame frame = new JFrame("Draw");
	
	public Main() {
		Container container = frame.getContentPane();
		JComponent pane = new MyPane();
		pane.setPreferredSize(new Dimension(400, 600));
		container.add(pane);
		frame.pack();
		frame.setResizable(false);
		System.out.println("Pane size " + pane.getSize());
		System.out.println("Frame size " + frame.getSize());

	}
	
	public static void main(String[] args) {
		new Main().exec();		

	}

	private void exec() {
		frame.setVisible(true);
	}

}
